package bpmn.diagram.providers;

import bpmn.BpmnFactory;
import bpmn.BpmnPackage;
import bpmn.Complex;
import bpmn.DataBased;
import bpmn.End;
import bpmn.EventType;
import bpmn.GatewayType;
import bpmn.Inclusive;
import bpmn.Intermediate;
import bpmn.Parallel;
import bpmn.Pool;
import bpmn.Process;
import bpmn.Task;
import bpmn.TaskType;
import bpmn.diagram.expressions.Bpmn_1_1AbstractExpression;
import bpmn.diagram.expressions.Bpmn_1_1OCLFactory;
import bpmn.diagram.part.Bpmn_1_1DiagramEditorPlugin;

/**
 * @generated
 */
public class ElementInitializers {

	protected ElementInitializers() {
		// use #getInstance to access cached instance
	}

	/**
	 * @generated
	 */
	public void init_Pool_2003(Pool instance) {
		try {
			Process newInstance_0_0 = BpmnFactory.eINSTANCE.createProcess();
			instance.setProcessRef(newInstance_0_0);
			newInstance_0_0.setName("New Process");

		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3002(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(1,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3009(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(3,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3014(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(5,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3015(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(7,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3016(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(9,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3017(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(11,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3018(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(13,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3019(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(15,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Task_3020(Task instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(17,
					BpmnPackage.eINSTANCE.getTask(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getTaskType());
			instance.setTaskType((TaskType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Intermediate_3004(Intermediate instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(20,
					BpmnPackage.eINSTANCE.getIntermediate(), null).evaluate(
					instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getEventType());
			instance.setEventType((EventType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_End_3005(End instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(22,
					BpmnPackage.eINSTANCE.getEnd(), null).evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getEventType());
			instance.setEventType((EventType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Inclusive_3010(Inclusive instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(23,
					BpmnPackage.eINSTANCE.getInclusive(), null).evaluate(
					instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getGatewayType());
			instance.setGatewayType((GatewayType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Complex_3011(Complex instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(24,
					BpmnPackage.eINSTANCE.getComplex(), null)
					.evaluate(instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getGatewayType());
			instance.setGatewayType((GatewayType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_Parallel_3012(Parallel instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(25,
					BpmnPackage.eINSTANCE.getParallel(), null).evaluate(
					instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getGatewayType());
			instance.setGatewayType((GatewayType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public void init_DataBased_3013(DataBased instance) {
		try {
			Object value_0 = Bpmn_1_1OCLFactory.getExpression(26,
					BpmnPackage.eINSTANCE.getDataBased(), null).evaluate(
					instance);

			value_0 = Bpmn_1_1AbstractExpression.performCast(value_0,
					BpmnPackage.eINSTANCE.getGatewayType());
			instance.setGatewayType((GatewayType) value_0);
		} catch (RuntimeException e) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Element initialization failed", e); //$NON-NLS-1$						
		}
	}

	/**
	 * @generated
	 */
	public static ElementInitializers getInstance() {
		ElementInitializers cached = Bpmn_1_1DiagramEditorPlugin.getInstance()
				.getElementInitializers();
		if (cached == null) {
			Bpmn_1_1DiagramEditorPlugin.getInstance().setElementInitializers(
					cached = new ElementInitializers());
		}
		return cached;
	}
}
